
<#include
        "../../common/com.html"  /> <@layout>
<head>
    <!-- page specific plugin styles -->
    <!-- ace styles -->
    <script src="${ctx}/static/inc/platform/js/ajax.js"></script>
    <link rel="stylesheet" type="text/css" href="${ctx}/static/cbb/artDialog/skins/blue.css">
    <script src="${ctx}/static/cbb/artDialog/jquery.artDialog.js"></script>
    <link rel="stylesheet" href="${ctx}/static/kindeditor/themes/default/default.css" />
    <script charset="utf-8" src="${ctx}/static/kindeditor/kindeditor-min.js"></script>
    <script charset="utf-8" src="${ctx}/static/kindeditor/lang/zh_CN.js"></script>
    <script charset="utf-8" src="${ctx}/static/kindeditor/plugins/code/prettify.js"></script>
    <script src="${ctx}/static/js/jquery.tools.js"></script>

</head>
<script type="text/javascript">
    //open new window
    function newModels(){
        var url = '${ctx}/wxMedia/newModes' ;
        initArtDialog({url:url, title:'新增', width:650, height:450,lock:true,background: '#EAEAEA'});
    }

    /**
     * 删除文件
     */
    function dels(filename,id){
        url = '${ctx}/wxImg/delfile/';
        $("#id").attr("value",id);
        $("#filename").attr("value",filename);

        $('#myform').form('submit', {
            url : url,
            onSubmit : function() {
            },
            success : function(data) {
                // 回填页面
                alert(data);
                window.location.reload();
            }
        });
    }

</script>
<body>

<div class="page-content">
    <div class="page-header">
        <h1>
            图片管理
            <small>
                <p><input type="text" id="url1" value="" /> <input type="button" id="image1" value="选择图片" />（本地上传）</p>

            </small>
        </h1>
    </div><!-- /.page-header -->


    <div class="row-fluid">
        <ul class="ace-thumbnails">
            <#list list as m>
            <li>
                <a  data-rel="colorbox">
                    <img alt="150x150" src="${(filePath)!}/${(m.img)!}"   style="width:150px;height:150px;"/>
                    <div class="text" >
                        <div class="inner">${(m.img)!}
                            </div>
                    </div>
                </a>
                <div class="tools tools-bottom">
                    <a href="#" onclick="dels('${(m.img)!}','${(m.id)!}');" >
                        <i class="icon-remove red  "></i>
                    </a>

                </div>
            </li>
                &nbsp;&nbsp;
                </#list>
        </ul>

    </div><!-- PAGE CONTENT ENDS -->

</div><!-- /.page-content -->
<form class="form-inline" id="myform">
    <input type="hidden" name="id" id="id">
    <input type="hidden" name="filename" id="filename">

</form>
<!-- page specific plugin scripts -->
<!--[if IE]>
<script type="text/javascript">
 window.jQuery || document.write("<script src='${ctx}/static/assets/js/jquery-1.10.2.min.js'>"+"<"+"/script>");
</script>
<![endif]-->


<script>
    function delfile(){
        alert("asd");
    }
    KindEditor.ready(function(K) {
        var editor = K.editor({
            cssPath : '${ctx}/static/kindeditor/plugins/code/prettify.css',
            uploadJson : '${ctx}/uploadMedia/upload/',
            fileManagerJson : '${ctx}/uploadMedia/manageImg',
            allowFileManager : true
        });
        K('#image1').click(function() {
            editor.loadPlugin('image', function() {
                editor.plugin.imageDialog({
                showRemote : false,
                    clickFn : function(url, title, width, height, border, align) {
                    	window.location.reload();
                        editor.hideDialog();
                    }
                });
            });
        });
    });
</script>
</body>
</@layout>
